]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Add shortcuts to summary boxpointer
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 15 Sep 2012 16:56:01 +0000 (18:56 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 18 Sep 2012 16:45:41 +0000 (18:45 +0200)
Currently opening the summary boxpointer acts as a stop gap for
keynav - the only shortcut still working is "Escape" to hide the
tray altogether.
Change the handling of Escape to only close the summary boxpointer
and allow to use the down arrow as alternative (unless the boxpointer
already processes the key press itself of course, like the chat
entry does). Also add a Delete shortcut to dismiss the open summary
item.

https://bugzilla.gnome.org/show_bug.cgi?id=682243

js/ui/messageTray.js

index a977295f7c405a75f4faf59e3595633cea72b88f..ff045e251cb64cf059ada806b3768fbd3a5ad47a 100644 (file)
@@ -1427,6 +1427,8 @@ const MessageTray = new Lang.Class({
         this._summaryBoxPointer = new BoxPointer.BoxPointer(St.Side.BOTTOM,
                                                             { reactive: true,
                                                               track_hover: true });
+        this._summaryBoxPointer.actor.connect('key-press-event',
+                                              Lang.bind(this, this._onSummaryBoxPointerKeyPress));
         this._summaryBoxPointer.actor.style_class = 'summary-boxpointer';
         this._summaryBoxPointer.actor.hide();
         Main.layoutManager.addChrome(this._summaryBoxPointer.actor);
@@ -2372,7 +2374,6 @@ const MessageTray = new Lang.Class({
         }
 
         this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child,
-                                untracked: true,
                                 grabFocus: true,
                                 onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) });
         this._lock();
@@ -2435,6 +2436,21 @@ const MessageTray = new Lang.Class({
         return true;
     },
 
+   _onSummaryBoxPointerKeyPress: function(actor, event) {
+       switch (event.get_key_symbol()) {
+           case Clutter.KEY_Down:
+           case Clutter.KEY_Escape:
+               this._setClickedSummaryItem(null);
+               this._updateState();
+               return true;
+           case Clutter.KEY_Delete:
+               this._clickedSummaryItem.source.destroy();
+               this._escapeTray();
+               return true;
+       }
+       return false;
+   },
+
     _onSummaryBoxPointerUngrabbed: function() {
         this._summaryBoxPointerState = State.HIDING;
         this._unlock();